package com.shop.milk_tea_shop.controller;

import com.shop.milk_tea_shop.dto.MenuDTO;
import com.shop.milk_tea_shop.manager.MenuManager;
import com.shop.milk_tea_shop.common.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author zrm
 * @since 2024-06-16
 */
@RestController
@RequestMapping("/itemInfo")
public class ItemInfoController {

    @Autowired
    MenuManager menuManager;

    @GetMapping("/menu")
    public Result<List<MenuDTO>> getMenu(){
        // 用户查询菜单接口（后修改为查缓存）
        return menuManager.getMenu();
    }

    @GetMapping("/menuManage")
    public Result<List<MenuDTO>> getMenuManage(){
        // 管理员查询菜单接口
        return menuManager.getMenu();
    }

    @PostMapping("/addCategory")
    public Result<Boolean> addCategory(){
        return null;
    }

}
